<template>
  <div class="mb20">
    <jxf-titletip :title="'代付详情' + (status === 1 ? '-处理中': status === 2 ? '-提现成功': status === 1 ? '-失败': '')" :hasRefresh="false" :hasGoBack="true"
                  @goBack="$emit('update:isShowDetail', false)"></jxf-titletip>
    <h4 class="mt20">订单信息</h4>
    <jxf-datalist class="mt20" :info="withdrawInfoList" :lineNum="2"></jxf-datalist>
    <h4 class="mt20">提现信息</h4>
    <jxf-datalist class="mt20" :info="auditInfoList"></jxf-datalist>
    <div class="mt20 text-center">
      <el-button type="info" @click="$emit('update:isShowDetail', false)">返回</el-button>
    </div>
  </div>
</template>

<script>
  import formatDate from '@/assets/js/formatDate'

  export default {
    name: "WithdrawCashLaunchDetail",
    props: {
      isShowDetail: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        status:null,
        withdrawInfoList:[],
        auditInfoList:[]
      }
    },
    methods: {
      getInfo(id){
        ajax.get(apis.factory.getWithdrawDetail, {id: id})
          .then(res => {
            if (res.success === true) {
              if (res.data !== [] && res.data !== null) {
                this.status = res.data.withdrawStatus
                this.formatData(res.data)
              } else {
                this.withdrawInfoList = []
                this.auditInfoList = []
              }
            }
          })
      },
      formatData(item) {
        this.auditStatus = item.auditStatus
        this.withdrawInfoList = [{
          label: "提现订单编号",
          value: item.applyNo
        }, {
          label: "代付方式",
          value: item.channel === 1 ? "通联" : ''
        }, {
          label: "订单金额",
          value: item.amount !== null && item.amount !== '' ? '￥' + item.amount : ""
        }, {
          label: "收款人姓名",
          value: item.ownerName
        }, {
          label: "手续费",
          value: item.chargeAmount !== null && item.chargeAmount !== '' ? '￥' + item.chargeAmount : ""
        }, {
          label: "银行卡号",
          value: item.cardNo
        }, {
          label: "申请提现时间",
          value: item.applyTime !== null && item.applyTime !== "" ? formatDate.timeFormat(item.applyTime) : ""
        }, {
          label: "开户行",
          value: item.bankName
        }]
        this.auditInfoList = [{
          label: "提现状态",
          value: item.withdrawStatus  === 1 ? '处理中' : item.withdrawStatus  === 2 ? '成功' : item.withdrawStatus  === 3 ? '失败' : ""
        }]
      }
    },
    created() {
    }
  }
</script>

<style lang="scss" scoped>

</style>
